Repository navigation
Conversation
|
Updated mergeability check: head 85fb08c merges cleanly into main 5fd4070. There is no local source conflict blocking this Windows console-handler change, so the earlier GitHub conflict indication should not be treated as an outstanding rebase request. Native Windows Ctrl-C behavior during loading and orderly shutdown still requires its platform-specific validation; no Windows run was performed for this update. |
yatesdr
left a comment
There was a problem hiding this comment.
Restoring the default Ctrl-C exit before serving is right for main's Windows path, but this edits a file that no longer exists, and nothing was compiled or run on Windows.
- Port it to main.
flare/src/main.rsmoved toflare-cli/src/main.rsin fa15828. On main, Windows serves throughserve_local(flare-cli/src/main.rs:630), and the console handler is installed at line 148; make the change there, before the server starts. GitHub reports the branch as conflicting. - Build and run it on Windows. Post the output of
cargo check --manifest-path flare-cli/Cargo.toml --target x86_64-pc-windows-msvc, and aflare run COREsession in which Ctrl-C during loading exits at once and Ctrl-C after "Start server" drains. - Docs.
docs/windows.md:141-142says Ctrl-C drains native work. State that before the server starts, Ctrl-C ends the process. - CONTRIBUTING.md requires
Signed-off-by; 85fb08c has none. Redo the design acknowledgment after porting;1c01matches the old base.
|
A case file has been opened for 178. Future reviews will auto-run 90 minutes after code updates are pushed.
|
Autobot ReviewFull Review for Agents · Value Proposition · Case File Recommendation: Changes RequestedThe diagnosis behind PR #178 is correct: Blockers:
Should fix:
Subtract / Simplify:Could remove ~14 of +8 added lines (the whole +8/−6 diff lands in a deleted file); the ported equivalent adds ~7, of which ~1 is cuttable:
Nits:3 nits — comment placement between Full detail, evidence and the verified non-findings: see the case file. To opt out, include #autobot:ignore in your post or comment. |
85fb08c to
43c6ea7
Compare
|
@yatesdr @flare-autobot Rebased onto
|
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedThe code and documentation diff at
Have your agent review the Full Review for complete verified findings, To opt out, include |
`flare run` on Windows previously registered `stop_console` via
`SetConsoleCtrlHandler` in `run()` (`flare-cli/src/main.rs`) before core
download, trust verification, and GPU model loading. Because `stop_console`
returns `1` ("handled") for `CTRL_C_EVENT` and `CTRL_BREAK_EVENT`, it
suppressed Windows's default process termination while nothing checked `STOP`
until the serving loop (`distribution` and `launch` are `#[cfg(unix)]`, and
Windows rejects multi-host flags). A Ctrl-C during download or loading was
therefore swallowed, leaving forced termination as the only exit path.
Installing the handler after `loaded.start()` in `serve_local()` rather than
earlier avoids keeping Ctrl-C suppressed in two places that never poll
`STOP`: Windows rejects multi-host flags before `serve()` and routes local
runs into `serve_local()`, while `loaded.start()` invokes `Server::start`
and runs startup tuning graphs (`helios/src/execution/transport.rs`) under a
120-second completion deadline before the serving loop starts. Returning an
error if `SetConsoleCtrlHandler` fails after `loaded.start()` remains safe
because `LoadedSession::start()` wraps the model owner in `DrainGuard` and
`ServingSession::drop()` calls `close()` (`helios/src/server/session.rs`),
draining or retaining GPU storage rather than releasing an undrained owner.
Removed the early `#[cfg(windows)]` `SetConsoleCtrlHandler(Some(stop_console), 1)`
block from `run()` in `flare-cli/src/main.rs` and added it in `serve_local()`
immediately after `loaded.start()` alongside the `#[cfg(unix)]` signal block,
retaining the `== 0` OS-error check. Left `serve()` unchanged and rewrote
the Ctrl-C sentence in `docs/windows.md` in place to state that Ctrl-C and
Ctrl-Break end loading immediately and drain native work before releasing
CUDA resources once serving has started.
On Windows, Ctrl-C and Ctrl-Break now preserve default immediate termination
throughout download, verification, loading, and server startup, and drain
native replay before releasing CUDA resources once serving begins. Unix
behavior is unchanged.
On a Linux x86_64 host against this commit's tree, `cargo test --locked
--release --manifest-path flare-cli/Cargo.toml` (with `CAP_DAC_OVERRIDE`
dropped via `setpriv` so read-only cache permission tests enforce `EACCES`)
passed (`exit 0`) across all five test binaries: `src/main.rs` unit tests
(201 passed, 0 failed, 3 ignored for multi-host hardware/payload fixtures),
`tests/cache_commands.rs` (9 passed), `tests/cli.rs` (6 passed),
`tests/inspect.rs` (4 passed), and `tests/unverified_payload.rs` (7 passed),
totaling 227 passed, 0 failed, and 3 ignored. Cross-compilation checking
from Linux via `cargo xwin check --locked --release --manifest-path
flare-cli/Cargo.toml --target x86_64-pc-windows-msvc` passed (`exit 0`),
verifying compilation of `flare-cli` including the `#[cfg(windows)]`
`SetConsoleCtrlHandler` path. Full cross-linking via `cargo xwin build
--locked --release` failed at `lld-link` (`exit 101`) due to pre-existing
cross-build mismatches unrelated to `flare-cli/src/main.rs`: default CRT
linking hit a `RuntimeLibrary` mismatch between `libflare_selene`
(`MD_DynamicRelease`) and `libesaxx_rs` (`MT_StaticRelease`), while
`RUSTFLAGS="-C target-feature=+crt-static"` hit undefined `__cpu_model` and
`__cpu_features2` symbols referenced by `libflare_selene`. Limitations:
Windows executable linking, Windows native test execution, and live Windows
`flare run CORE` Ctrl-C verification (immediate termination during loading
and clean drain after `"Start server"`) were not run.
Refs: NVIDIA#113
Signed-off-by: Mark Yong <mark-yong@users.noreply.github.com>
Design-Signed-Off-By: Antigravity (Gemini 4 Neon); design-review=2e5b
43c6ea7 to
20d2c65
Compare
|
@yatesdr @flare-autobot Rebased onto
|
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Ready To MergeMinimal root-cause fix that relocates the Windows console handler to match Unix placement, restoring Ctrl-C/Break during download, loading, and startup. Docs and code are consistent; only an optional live Windows smoke test remains.
Walkthrough
Merge Risk: Low · up to
|
Refs #113
Request
flare runon Windows previously installed its console control handler (stop_console) viaSetConsoleCtrlHandlerinrun()(flare-cli/src/main.rs) before core download, trust verification, and GPU model loading. Becausestop_consolereturns1("handled") forCTRL_C_EVENTandCTRL_BREAK_EVENT, it suppressed Windows's default process termination while nothing checkedSTOPuntil the serving loop (distributionandlaunchare#[cfg(unix)], and Windows rejects multi-host flags). A Ctrl-C during download or loading was therefore swallowed on Windows, leaving forced process termination as the only exit path.Installing the handler after
loaded.start()inserve_local()rather than inrun(),serve(), or beforeloaded.start()avoids keeping Ctrl-C suppressed where nothing pollsSTOP:run(), soserve()delegates local runs toserve_local()and never enters its multi-hostServer::start()path on Windows.loaded.start()would suppress Ctrl-C whileLoadedSession::start()callsServer::startand executes startup tuning graphs (helios/src/execution/transport.rs) under a 120-second completion deadline before the serving loop starts.SetConsoleCtrlHandlerfails afterloaded.start()remains safe becauseLoadedSession::start()guards the model owner withDrainGuardandServingSession::drop()callsclose()(helios/src/server/session.rs), draining or retaining GPU storage rather than releasing an undrained owner.Change
flare-cli/src/main.rs: Removed the early#[cfg(windows)]SetConsoleCtrlHandler(Some(stop_console), 1)registration fromrun(), and added it inserve_local()immediately afterloaded.start()alongside the#[cfg(unix)]SIGINT/SIGTERMblock, keeping the== 0OS-error check. Leftserve()unchanged.docs/windows.md: Rewrote the Ctrl-C sentence in place to state that Ctrl-C and Ctrl-Break end loading immediately and drain native work before releasing CUDA resources once serving has started.Expected Result
On Windows, Ctrl-C and Ctrl-Break keep the default immediate process termination throughout core download, verification, loading, and server startup, and drain native replay before releasing CUDA resources once serving has started. Unix builds and behavior are unchanged.
Validation
On a Linux x86_64 host against commit
20d2c655,cargo test --locked --release --manifest-path flare-cli/Cargo.toml(withCAP_DAC_OVERRIDEdropped viasetprivso read-only cache-directory tests enforceEACCES) passed (exit 0) across all five test binaries:src/main.rsunit tests: 201 passed, 0 failed, 3 ignored (export_signed_payload_distribution_fixture,receive_rank_accepts_old_metadata_with_empty_platform,serve_ring_transfer_fixture)tests/cache_commands.rs: 9 passed, 0 failed, 0 ignoredtests/cli.rs: 6 passed, 0 failed, 0 ignoredtests/inspect.rs: 4 passed, 0 failed, 0 ignoredtests/unverified_payload.rs: 7 passed, 0 failed, 0 ignoredCross-compilation checking from Linux against commit
20d2c655viacargo xwin check --locked --release --manifest-path flare-cli/Cargo.toml --target x86_64-pc-windows-msvcexited0, confirming Rust compilation offlare-cliincluding the#[cfg(windows)]SetConsoleCtrlHandlerchange with zero errors inflare-cli/src/main.rs. Full cross-linking viacargo xwin build --locked --release --manifest-path flare-cli/Cargo.toml --target x86_64-pc-windows-msvccompiledflare-cliRust objects cleanly and failed atlld-link(exit 101) due to pre-existing cross-build mismatches unrelated toflare-cli/src/main.rs: default CRT linking hit aRuntimeLibrarymismatch betweenlibflare_selene(MD_DynamicRelease) andlibesaxx_rs(MT_StaticRelease), whileRUSTFLAGS="-C target-feature=+crt-static"hit undefined__cpu_modeland__cpu_features2symbols referenced bylibflare_selene.Limitations
lld-linkfailed onlibflare_selene/libesaxx_rsas noted above) and Windows native test execution (windows-2022CI triggered on push) were not run locally.flare run COREexecution demonstrating immediate exit on Ctrl-C during loading and clean drain after"Start server"was not run.Discord: myong_acct